<?php


namespace App\Http\Controllers\applets\model;


use Illuminate\Support\Facades\DB;

class BatchModel
{
    public static function queryWhereCount($where){
        return DB::table('t_batch')->where($where)->count('id');
    }

    public static function queryFirst($where,$field){
        return DB::table('t_batch')->where($where)->first($field);
    }

    public static function queryWhere($where,$field){
        return DB::table('t_batch')->where($where)->get($field);
    }

    public static function add($param){
        return DB::table('t_batch')->insert($param);
    }

    public static function queryLeftAdmin($where,$field){
        return DB::table('t_batch as b')
            ->leftJoin('t_admin as a','b.admin_id','=','a.id')
            ->where($where)
            ->first($field);
    }
}